using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using SCS.Common.Models;
namespace SCS.DAL.Mapping
{
    public class SchoolYearMap : EntityTypeConfiguration<SchoolYear>
    {
        public SchoolYearMap()
        {
            // Primary Key
            this.HasKey(t => t.schoolYearID);

            // Properties
            this.Property(t => t.schoolYearID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.schoolYearName)
                .IsRequired()
                .HasMaxLength(15);

            // Table & Column Mappings
            this.ToTable("SchoolYear");
            this.Property(t => t.schoolYearID).HasColumnName("schoolYearID");
            this.Property(t => t.schoolYearName).HasColumnName("schoolYearName");
            this.Property(t => t.startDate).HasColumnName("startDate");
            this.Property(t => t.endDate).HasColumnName("endDate");
        }
    }
}
